
#ifndef PF_COMMANDS_H
#define PF_COMMANDS_H

#include <QMultiHash>

#include "lx_define.h"
#include "lx_Export.h"

#define PF_COMMANDS PF_Commands::instance()

/**
 * Class which holds all commands for the command line. This 
 * is separated in this module to alow the use of different
 * languages for the gui and the command interface.
 * Implemented as singleton. 
 */
class LX_EXPORT PF_Commands : public QObject {
    Q_OBJECT

public:
    /**
     * @return Instance to the unique commands object.
     */
    static PF_Commands* instance() {
        if (uniqueInstance==NULL) {
            uniqueInstance = new PF_Commands();
        }
        return uniqueInstance;
    }

        QStringList complete(const QString& cmd);
    LX_Define::ActionType cmdToAction(const QString& cmd);
    LX_Define::ActionType keycodeToAction(const QString& code);

    static QString command(const QString& cmd);

    static bool checkCommand(const QString& cmd, const QString& str,
                             LX_Define::ActionType action=LX_Define::ActionNone);

        static QString msgAvailableCommands();
		 

protected:
   
	static PF_Commands* uniqueInstance;
private:
	PF_Commands();
        QMultiHash<QString, LX_Define::ActionType> mainCommands;
        QMultiHash<QString, LX_Define::ActionType> shortCommands;
};

#endif

